search string inside array of objects php

135

search string inside array of objects php -

$item = null;
foreach($array as $struct) {
    if ($v == $struct->ID) {
        $item = $struct;
        break;
    }
}

Comments

Submit
0 Comments